package factory

type Contract interface {
	GetContractNo() string
}

func NewContract(ctype string) Contract {
	switch ctype {
	case "ad":
		return &AdContract{
			ContractNo: "",
			AdName:     "",
		}
	case "dsp":
		return &FrameworkContract{
			ContractNo: "",
			DepositFee: 0,
		}
	case "framework":
		return &FrameworkContract{
			ContractNo: "",
			DepositFee: 0,
		}
	default:
		return nil
	}
}

// AdContract is single ad contract
type AdContract struct {
	ContractNo string
	AdName     string
}

func (a *AdContract) GetContractNo() string {
	return a.ContractNo
}

// DspContract is dsp charge contract
type DspContract struct {
	ContractNo string
	ChargeFee  float64
}

func (d *DspContract) GetContractNo() string {
	return d.ContractNo
}

// FrameworkContract is the framework contract
type FrameworkContract struct {
	ContractNo string
	DepositFee float64
}

func (f *FrameworkContract) GetContractNo() string {
	return f.ContractNo
}
